package com.hc.fdkgoods.dao;


import com.hc.fdkgoods.vo.vo_2.ForwarderSummaryVO;
import org.springframework.stereotype.Repository;


import static com.hc.fdkgoods.db.Tables.SELLER_TO_PREPARE_SKU_LIST;
import static org.jooq.impl.DSL.*;

@Repository
public class ForwarderSummaryListDao extends BaseDao{
    public ForwarderSummaryVO queryForwarderSummaryList(){
        ForwarderSummaryVO forwarderSummaryVO=new ForwarderSummaryVO();

        forwarderSummaryVO.setSkuCount(db.select(countDistinct(SELLER_TO_PREPARE_SKU_LIST.SELLER_SKU_ID)).from(SELLER_TO_PREPARE_SKU_LIST).fetchAnyInto(Long.class));
        forwarderSummaryVO.setSkuSum(db.select(sum(SELLER_TO_PREPARE_SKU_LIST.SKU_NUM)).from(SELLER_TO_PREPARE_SKU_LIST).fetchAnyInto(Long.class));
        return forwarderSummaryVO;

    }
}
